/*******************************************************************************
 * 
 * Copyright:
 * 
 * License:
 * 
 * Authors: SALMON Charles
 * 
 ******************************************************************************/

/*******************************************************************************
 * 
 ******************************************************************************/

/**
 * A singleton to get shared services for the authorview
 */
qx.Class.define("bip.authorview.SharedServices", {
	extend : qx.core.Object,
	
	type: "singleton",
	
	/*
	 * ****************************************************************************
	 * CONSTRUCTOR
	 * ****************************************************************************
	 */

	construct : function() {
		this.base(arguments);
	},

	/*
	 * ****************************************************************************
	 * PROPERTIES
	 * ****************************************************************************
	 */

	properties : {

	},

	/*
	 * ****************************************************************************
	 * MEMBERS
	 * ****************************************************************************
	 */

	members : {
		__topicService:null,
		__questionService:null,
		
		getTopicService: function() {
			if (! this.__topicService) {
				this.__topicService = new bip.services.TopicService();
			}
			return this.__topicService;
		},
		
		getQuestionService: function() {
			if (! this.__questionService) {
				this.__questionService = new bip.services.QuestionService();
			}
			return this.__questionService;
		}

	},

	/*
	 * ****************************************************************************
	 * DESTRUCTOR
	 * ****************************************************************************
	 */

	destruct : function() {
		this._disposeObjects("__topicService","__questionService");
	}
});
